package com.rednote.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rednote.entity.Posts;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 用户帖子表(Posts)数据库访问层
 *
 * @author yao suxuan
 * @since 2025-05-24 18:10:30
 */
@Mapper
public interface PostsMapper extends BaseMapper<Posts> {
    @Update("UPDATE posts SET collect_count = collect_count + #{delta} WHERE post_id = #{postId}")
    int updateCollectCount(@Param("postId") Integer postId, @Param("delta") int delta);

}
